#!/bin/bash

source $DRAW_INI
source $DRAW_CFG


java -Xmx4G -jar $GENOMICS_JAR/snpEff_lastest/snpEff.jar \
              -c $GENOMICS_JAR/snpEff_lastest/snpEff.config \
              -i VCF \
              -o VCF \
              $2 \
              $1.vcf > ${1}_snpeff.vcf


EXITSTATUS=$?

#force error when missing output
if [ ! -s "${1}_snpeff.vcf" ]; then exit 100;fi;
if [ $(grep -cv "^#" "${1}_snpeff.vcf") -eq "0" ]
 then
  echo "No variants!"
  exit 100;
fi

if [ $EXITSTATUS -eq 1 ];then
  echo "Error in Java"	
  exit 100
fi
#              ce.WS220.61 \
